package view.statistic;

import java.util.Observer;

import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.border.TitledBorder;

import lib.MyUtils;
import controller.statistic.StatisticControl;
public class StatisticPanelDay extends javax.swing.JPanel {
	private static final long serialVersionUID = 1L;
	private JButton btn_prodmain_search;
	private JButton btn_prodmain_search1;
	private JButton btn_prodmain_search2;
	private JComboBox<String> cbb_prodmain_searchby2;
	private JLabel jLabel1;
	private JScrollPane jScrollPane1;
	private JScrollPane jScrollPane2;
	private JPanel pn_prodmain_information;
	private JPanel pn_prodmain_listproduct;
	private JTable tbl_prodmain_listproduct;
	private JTable tbl_prodmain_listproduct1;
	private JTextField txt_prodmain_search;
	
	private StatisticControl controller;
	
	
	public JButton getBtn_prodmain_search() {
		return btn_prodmain_search;
	}

	public void setBtn_prodmain_search(JButton btn_prodmain_search) {
		this.btn_prodmain_search = btn_prodmain_search;
	}

	public JButton getBtn_prodmain_search1() {
		return btn_prodmain_search1;
	}

	public void setBtn_prodmain_search1(JButton btn_prodmain_search1) {
		this.btn_prodmain_search1 = btn_prodmain_search1;
	}

	public JButton getBtn_prodmain_search2() {
		return btn_prodmain_search2;
	}

	public void setBtn_prodmain_search2(JButton btn_prodmain_search2) {
		this.btn_prodmain_search2 = btn_prodmain_search2;
	}

	public JComboBox<String> getCbb_prodmain_searchby2() {
		return cbb_prodmain_searchby2;
	}

	public void setCbb_prodmain_searchby2(JComboBox<String> cbb_prodmain_searchby2) {
		this.cbb_prodmain_searchby2 = cbb_prodmain_searchby2;
	}

	public JLabel getjLabel1() {
		return jLabel1;
	}

	public void setjLabel1(JLabel jLabel1) {
		this.jLabel1 = jLabel1;
	}

	public JScrollPane getjScrollPane1() {
		return jScrollPane1;
	}

	public void setjScrollPane1(JScrollPane jScrollPane1) {
		this.jScrollPane1 = jScrollPane1;
	}

	public JScrollPane getjScrollPane2() {
		return jScrollPane2;
	}

	public void setjScrollPane2(JScrollPane jScrollPane2) {
		this.jScrollPane2 = jScrollPane2;
	}

	public JPanel getPn_prodmain_information() {
		return pn_prodmain_information;
	}

	public void setPn_prodmain_information(JPanel pn_prodmain_information) {
		this.pn_prodmain_information = pn_prodmain_information;
	}

	public JPanel getPn_prodmain_listproduct() {
		return pn_prodmain_listproduct;
	}

	public void setPn_prodmain_listproduct(JPanel pn_prodmain_listproduct) {
		this.pn_prodmain_listproduct = pn_prodmain_listproduct;
	}

	public JTable getTbl_prodmain_listproduct() {
		return tbl_prodmain_listproduct;
	}

	public void setTbl_prodmain_listproduct(JTable tbl_prodmain_listproduct) {
		this.tbl_prodmain_listproduct = tbl_prodmain_listproduct;
	}

	public JTable getTbl_prodmain_listproduct1() {
		return tbl_prodmain_listproduct1;
	}

	public void setTbl_prodmain_listproduct1(JTable tbl_prodmain_listproduct1) {
		this.tbl_prodmain_listproduct1 = tbl_prodmain_listproduct1;
	}

	public JTextField getTxt_prodmain_search() {
		return txt_prodmain_search;
	}

	public void setTxt_prodmain_search(JTextField txt_prodmain_search) {
		this.txt_prodmain_search = txt_prodmain_search;
	}

	public StatisticPanelDay() {
		initComponents();
		MyUtils.loadStatistic(this);
	}

	private void initComponents() {	
		pn_prodmain_information = new JPanel();
		jScrollPane2 = new JScrollPane();
		tbl_prodmain_listproduct1 = new JTable();
		btn_prodmain_search1 = new JButton();
		btn_prodmain_search2 = new JButton();
		cbb_prodmain_searchby2 = new JComboBox<String>();
		pn_prodmain_listproduct = new JPanel();
		jScrollPane1 = new JScrollPane();
		tbl_prodmain_listproduct = new JTable();
		txt_prodmain_search = new JTextField();
		btn_prodmain_search = new JButton();
		jLabel1 = new JLabel();
		
		controller = new StatisticControl(this);
		
		

		pn_prodmain_information
				.setBackground(new java.awt.Color(255, 255, 255));
		pn_prodmain_information.setBorder(BorderFactory.createTitledBorder(null,
				"Information", TitledBorder.DEFAULT_JUSTIFICATION,
				TitledBorder.DEFAULT_POSITION, new java.awt.Font("Calibri", 1,
						12), java.awt.Color.blue)); 

		tbl_prodmain_listproduct1.setFont(new java.awt.Font("Calibri", 1, 12));
		jScrollPane2.setViewportView(tbl_prodmain_listproduct1);

		btn_prodmain_search1.setFont(new java.awt.Font("Calibri", 1, 12)); 
		btn_prodmain_search1.setText("Search");

		btn_prodmain_search2.setFont(new java.awt.Font("Calibri", 1, 12)); 
		btn_prodmain_search2.setText("Filter");


		GroupLayout pn_prodmain_informationLayout = new GroupLayout(
				pn_prodmain_information);
		pn_prodmain_information.setLayout(pn_prodmain_informationLayout);
		pn_prodmain_informationLayout
				.setHorizontalGroup(pn_prodmain_informationLayout
						.createParallelGroup(GroupLayout.Alignment.LEADING)
						.addComponent(jScrollPane2,
								GroupLayout.Alignment.TRAILING)
						.addGroup(
								GroupLayout.Alignment.TRAILING,
								pn_prodmain_informationLayout
										.createSequentialGroup()
										.addContainerGap(
												GroupLayout.DEFAULT_SIZE,
												Short.MAX_VALUE)
										.addComponent(cbb_prodmain_searchby2,
												GroupLayout.PREFERRED_SIZE, 79,
												GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(btn_prodmain_search2,
												GroupLayout.PREFERRED_SIZE, 90,
												GroupLayout.PREFERRED_SIZE)
										.addContainerGap())
						.addGroup(
								pn_prodmain_informationLayout
										.createParallelGroup(
												GroupLayout.Alignment.LEADING)
										.addGroup(
												pn_prodmain_informationLayout
														.createSequentialGroup()
														.addGap(526, 526, 526)
														.addComponent(
																btn_prodmain_search1,
																GroupLayout.PREFERRED_SIZE,
																90,
																GroupLayout.PREFERRED_SIZE)
														.addContainerGap(258,
																Short.MAX_VALUE))));
		pn_prodmain_informationLayout
				.setVerticalGroup(pn_prodmain_informationLayout
						.createParallelGroup(GroupLayout.Alignment.LEADING)
						.addGroup(
								GroupLayout.Alignment.TRAILING,
								pn_prodmain_informationLayout
										.createSequentialGroup()
										.addGroup(
												pn_prodmain_informationLayout
														.createParallelGroup(
																GroupLayout.Alignment.BASELINE)
														.addComponent(
																cbb_prodmain_searchby2,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																btn_prodmain_search2))
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(jScrollPane2,
												GroupLayout.DEFAULT_SIZE, 250,
												Short.MAX_VALUE))
						.addGroup(
								pn_prodmain_informationLayout
										.createParallelGroup(
												GroupLayout.Alignment.LEADING)
										.addGroup(
												pn_prodmain_informationLayout
														.createSequentialGroup()
														.addGap(122, 122, 122)
														.addComponent(
																btn_prodmain_search1)
														.addContainerGap(123,
																Short.MAX_VALUE))));

		pn_prodmain_listproduct
				.setBackground(new java.awt.Color(255, 255, 255));
		pn_prodmain_listproduct.setBorder(BorderFactory.createTitledBorder(null,
				"Statistic", TitledBorder.DEFAULT_JUSTIFICATION,
				TitledBorder.DEFAULT_POSITION, new java.awt.Font("Calibri", 1,
						12), java.awt.Color.blue));

		tbl_prodmain_listproduct.setFont(new java.awt.Font("Calibri", 1, 12)); 

		jScrollPane1.setViewportView(tbl_prodmain_listproduct);

		btn_prodmain_search.setFont(new java.awt.Font("Calibri", 1, 12)); 
		btn_prodmain_search.setText("Search");

		jLabel1.setText("Date:");

		GroupLayout pn_prodmain_listproductLayout = new GroupLayout(
				pn_prodmain_listproduct);
		pn_prodmain_listproduct.setLayout(pn_prodmain_listproductLayout);
		pn_prodmain_listproductLayout
				.setHorizontalGroup(pn_prodmain_listproductLayout
						.createParallelGroup(GroupLayout.Alignment.LEADING)
						.addGroup(
								GroupLayout.Alignment.TRAILING,
								pn_prodmain_listproductLayout
										.createSequentialGroup()
										.addContainerGap(
												GroupLayout.DEFAULT_SIZE,
												Short.MAX_VALUE)
										.addComponent(jLabel1)
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.UNRELATED)
										.addComponent(txt_prodmain_search,
												GroupLayout.PREFERRED_SIZE,
												113, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(btn_prodmain_search,
												GroupLayout.PREFERRED_SIZE, 90,
												GroupLayout.PREFERRED_SIZE)
										.addContainerGap())
						.addComponent(jScrollPane1,
								GroupLayout.Alignment.TRAILING,
								GroupLayout.DEFAULT_SIZE, 874, Short.MAX_VALUE));
		pn_prodmain_listproductLayout
				.setVerticalGroup(pn_prodmain_listproductLayout
						.createParallelGroup(GroupLayout.Alignment.LEADING)
						.addGroup(
								GroupLayout.Alignment.TRAILING,
								pn_prodmain_listproductLayout
										.createSequentialGroup()
										.addGroup(
												pn_prodmain_listproductLayout
														.createParallelGroup(
																GroupLayout.Alignment.BASELINE)
														.addComponent(
																txt_prodmain_search,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																btn_prodmain_search)
														.addComponent(jLabel1))
										.addPreferredGap(
												LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(jScrollPane1,
												GroupLayout.DEFAULT_SIZE, 90,
												Short.MAX_VALUE)));

		GroupLayout layout = new GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup()
						.addContainerGap()
						.addGroup(
								layout.createParallelGroup(
										GroupLayout.Alignment.LEADING)
										.addComponent(pn_prodmain_information,
												GroupLayout.DEFAULT_SIZE,
												GroupLayout.DEFAULT_SIZE,
												Short.MAX_VALUE)
										.addComponent(pn_prodmain_listproduct,
												GroupLayout.DEFAULT_SIZE,
												GroupLayout.DEFAULT_SIZE,
												Short.MAX_VALUE))
						.addContainerGap()));
		layout.setVerticalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addComponent(pn_prodmain_information,
										GroupLayout.DEFAULT_SIZE,
										GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE)
								.addPreferredGap(
										LayoutStyle.ComponentPlacement.RELATED)
								.addComponent(pn_prodmain_listproduct,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.DEFAULT_SIZE,
										GroupLayout.PREFERRED_SIZE)
								.addContainerGap()));
	}
	
	public Observer getObserver(){
		return controller;
	}
}
